import unittest
from main import generate_pages_list, split_page_parts


class MyTestCase(unittest.TestCase):
    def test_generate_pages_list(self):
        self.assertEqual([2, 3, 4, 5], generate_pages_list(2, 5))

    def test_split_page_parts(self):
        lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
        self.assertEqual([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]], split_page_parts(lst, 3))
        self.assertEqual([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10]], split_page_parts(lst, 4))

    def test_first_last(self):
        lst = [2, 3, 4, 5, 6, 7, 8, 9]
        self.assertEqual(2, lst[0])
        self.assertEqual(9, lst[-1])


if __name__ == '__main__':
    unittest.main()
